﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using _708DllLibrary;

namespace _708DllTest
{
    public partial class Form1 : Form
    {
        [DllImport("SatOrbAndCovd.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "?AlphaGreenCalculation@SatArithmetic@@YANN@Z")]
        public static extern double AlphaGreenCalculation(int year, int month, int day, int hour, int minute, double second);

        [DllImport("J2KECFDLL.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "?ECI2ECF@@YAXOQEAO0@Z")]
        public static extern void ECI2ECF(double mjd, double[] ECFpos, double[] ECIpos);
        
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            double [] input={ -1033.479383, 7901.2952754, 6380.3565958 };
            double[] output = new double[3];
            ECI2ECF(54195.5, input, output);
            this.textBox1.Text = output[0] + "," + output[1] + "," +output[2];
            
        }




    }
}
